package com.chenyongjing.design.pattern.memento.general;

import java.util.Stack;

/**
 * @Author chen
 * @Date 2022/11/23 22:12
 */
public class Caretaker {
    private final Stack<Memento> STACK = new Stack<Memento>();

    public Memento getMemento() {
        return STACK.pop();
    }

    public void stroeMemento(Memento memento){
        STACK.push(memento);
    }

    @Override
    public String toString() {
        return "Caretaker{" +
                "STACK=" + STACK +
                '}';
    }
}
